<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title><?php echo $pageTitle?></title>
	<link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url();?>sknimg/img/isee.ico" />
	<link href="<?php echo base_url();?>sknimg/css/userarea.css" rel="stylesheet" type="text/css" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url();?>sknimg/img/icon.png" />
	
	<script type='text/javascript' src="<?php echo base_url();?>sknimg/js/<?php echo $js1?>"></script>
	<script type='text/javascript' src="<?php echo base_url();?>sknimg/js/<?php echo $js2?>"></script>
    <script type='text/javascript' src="<?php echo base_url();?>sknimg/js/<?php echo $js3?>"></script>
    <script type='text/javascript' src="<?php echo base_url();?>sknimg/js/jquery-ui-1.8.1.custom.min.js"></script>
	<link type="text/css" href="<?php echo base_url();?>sknimg/css/js-ui-css/ui-lightness/jquery-ui-1.8.1.custom.css" rel="stylesheet" />
	
	<?php if($this->session->userdata('isLogin')){?>
	<script type="text/javascript">
	<?php if(!$isMyProfile){?>
		<?php if(!$isMyFriend){?>
			<?php if(!$isWait){?>
	
	$(document).ready(function() {
		var $dialog = $("#dialog-confirm").dialog({
			resizable: false,
			autoOpen: false,
			height:200,
			width:300,
			modal: true,
			buttons: {
				'Kirim': function() {
					var submitData = $('#friendForm').serialize();
					
					$.ajax({
						type: "POST",
						url: "<?php echo base_url()?>engine/friendEngine/request/",
						data: submitData,
						dataType: "json",
						success: function(msg){
							if(msg.success==true){
								$('#add_friend').hide();
								$('#wait_friend').show();
								$dialog.dialog('close');
								
							}else{
								$dialog.dialog('close');
							}
						}
					});
		
					
				},
				'Batal': function() {
					$(this).dialog('close');
				}
			}
		});
	

	$('#add_friend').click(function() {
		$dialog.dialog('open');
	});

	});
	
	
	<?php }}else{?>
		$(document).ready(function() {
			var $dialog = $("#dialog-confirm").dialog({
				resizable: false,
				autoOpen: false,
				height:200,
				width:300,
				modal: true,
				buttons: {
					'Kirim': function() {
						var submitData = $('#friendForm').serialize();
						
						$.ajax({
							type: "POST",
							url: "<?php echo base_url()?>engine/friendEngine/request/",
							data: submitData,
							dataType: "json",
							success: function(msg){
								if(msg.success==true){
									$('#add_friend').hide();
									$('#wait_friend').show();
									$dialog.dialog('close');
									
								}else{
									$dialog.dialog('close');
								}
							}
						});
			
						
					},
					'Batal': function() {
						$(this).dialog('close');
					}
				}
			});
			
			var $dialog2 = $("#dialog-remove").dialog({
				resizable: false,
				autoOpen: false,
				height:200,
				width:300,
				modal: true,
				buttons: {
					'Kirim': function() {
						var submitData = $('#friendForm').serialize();
						
						$.ajax({
							type: "POST",
							url: "<?php echo base_url()?>engine/friendEngine/removeUs/",
							data: submitData,
							dataType: "json",
							success: function(msg){
								if(msg.success==true){
									$('#add_friend').show();
									$('#remove_friend').hide();
									$dialog2.dialog('close');
									
								}else{
									$dialog2.dialog('close');
								}
							}
						});
			
						
					},
					'Batal': function() {
						$(this).dialog('close');
					}
				}
			});
			
			
		
	
		$('#add_friend').click(function() {
			$dialog.dialog('open');
		});
		
		
		$('#remove_friend').click(function() {
			$dialog2.dialog('open');
		});
	
		});
	<?php }}?>
	
	</script>
	<?php }?>

</head>
<body>
		
		<?php if($this->session->userdata('isLogin')){?>
		<?php if(!$isMyProfile){?>
		<?php if(!$isMyFriend){?>
			<?php if(!$isWait){?>
			<div id="dialog-confirm" title="Mengirim Permintaan untuk berteman">
				<p style="font-size:11px;">
				<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;">
				</span>Anda akan mengirimkan permintaan untuk berteman dengan <?php echo $nama_prof?>. Apakah anda yakin?</p>
			</div>
			<?php }}else{?>
				<div id="dialog-confirm" title="Mengirim Permintaan untuk berteman">
				<p style="font-size:11px;">
				<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;">
				</span>Anda akan mengirimkan permintaan untuk berteman dengan <?php echo $nama_prof?>. Apakah anda yakin?</p>
			</div>
				<div id="dialog-remove" title="Menghentikan Pertemanan">
				<p style="font-size:11px;">
				<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;">
				</span>Anda akan menghapus pertemanan anda dengan <?php echo $nama_prof?>. Apakah anda yakin?</p>
			</div>
			<?php }}?>
			<?php }?>
			
		<div id="wraper">
			<div id="headeruser">
					<div class="logo"><a href="<?php echo base_url()?>dashboard"><img src="<?php echo base_url();?>sknimg/images/transp_user.png" border="0" /></div>
				<?php if($this->session->userdata('isLogin')):?>
			<!--  	<div class='whoLoggedIn' style="float:left">
					<a href="<?php echo base_url()?>profile/info/"><?php echo $nama?></a>
				</div>-->
				<?php endif;?>
				<div class="nav">
					<ul>
					<?php if($this->session->userdata('isLogin')):?>
						<li><a href="<?php echo base_url()?>dashboard">Dashboard</a></li>
						<li><a href="<?php echo base_url()?>home/logout"><b>Logout</b></a></li>
					<?php endif;?>
					</ul>					
				</div>	
			</div>
			
			

			<div class="skin">
				<div id="content">
					
					<div class="avatar">
					
					
					
					
					
						<div class="name"><a href="<?php echo base_url()?>profile/info/<?php echo $username?>"><?php echo $nama_prof?></a></div>
						
							
						
						<?php if($this->session->userdata('isLogin')){?>
						<?php if(!$isMyProfile):?>
						<div id="friend" style="margin-left:20px;">
						<?php if(!$isMyFriend){?>
							<?php if(!$isWait){?>							
							<div id="add_friend">
								<a href="javascript:;" style="border:0;text-decoration:none;"><img border="0"src="<?php echo base_url()?>sknimg/img/add_friend.gif" width="15"></img>
								Add Friend</a>
							</div>
							<div id="wait_friend" style="display:none;">
									<a href="javascript:;" style="border:0;text-decoration:none;">
									<img border="0"src="<?php echo base_url()?>sknimg/img/add_friend.gif" width="15"></img>
								Menunggu Konfirmasi</a>
							</div>
							<form id="friendForm">
							<input type="hidden" name='user_id' value='<?php echo $this->session->userdata('userId')?>'>
							<input type="hidden" name='friend_id' value='<?php echo $id_prof?>'>
							</form>
							
							<?php }else{?>
								<div id="wait_friend">
									<a href="javascript:;" style="border:0;text-decoration:none;"><img border="0"src="<?php echo base_url()?>sknimg/img/add_friend.gif" width="15"></img>
								Menunggu Konfirmasi</a>
								</div>
							<?php }?>
						<?php }else{?>
							<div id="add_friend" style="display:none">
								<a href="javascript:;" style="border:0;text-decoration:none;"><img border="0"src="<?php echo base_url()?>sknimg/img/add_friend.gif" width="15"></img>
								Add Friend</a>
							</div>
							<form id="friendForm">
							<input type="hidden" name='user_id' value='<?php echo $this->session->userdata('userId')?>'>
							<input type="hidden" name='friend_id' value='<?php echo $id_prof?>'>
							</form>
							
							<div id="remove_friend">
								<a href="javascript:;" style="border:0;text-decoration:none;"><img border="0"src="<?php echo base_url()?>sknimg/img/cross.png" width="15"></img>
								Remove Friend</a>
							</div>
						<?php }?>	
						</div>
						<?php endif;?>
						<?php }?>
						
					
					
						<div class="picAvatar">
							<div id='photo'>
								<img width='200px' height='200px' src='<?php echo base_url()."sknimg/i-see-attr/avatar/".$avatar?>'></img>
							</div>	
						</div>
						
						
						
					</div>
					
					
					
						
						
						
						
					<div class="contentuser">
					<div class="menuuser">
							<a href="<?php echo base_url()?>profile/info/<?php echo $username?>" class='onpage'>Info</a>
							<a href="<?php echo base_url()?>profile/contact/<?php echo $username?>">Contact</a>
							<a href="<?php echo base_url()?>profile/echos/<?php echo $username?>">Echos</a>
					</div>
		
						
						<table>
							<tr>
								<td>
									NIM
								</td>
								<td>
									: <?php echo $nim?>
								</td>
							</tr>
							<tr>
								<td>
									Nama
								</td>
								<td>
									: <?php echo $nama_prof?>
								</td>
							</tr>
							<?php if($tglLahir!="0000-00-00"):?>
							<tr>
								<td>
									Tgl Lahir
								</td>
								<td>
									: <?php echo $tglLahir?>
								</td>
							</tr>
							<?php endif;?>
							<?php if($gender!=""):?>
							<tr>
								<td>
									Jenis Kelamin
								</td>
								<td>
									: <?php echo $gender?>
								</td>
							</tr>
							<?php endif;?>
							<?php if($location!=""):?>
							<tr>
								<td>
									Alamat
								</td>
								<td>
									: <?php echo $location?>
								</td>
							</tr>
							<?php endif;?>
							<?php if($about_me!=""):?>
							<tr>
								<td>
									About Me
								</td>
								<td>
									: <?php echo $about_me?>
								</td>
							</tr>
							<?php endif;?>
							<?php if($reg_date!=""):?>
							<tr>
								<td>
									Tanggal Bergabung
								</td>
								<td>
								: <?php echo $reg_date?>
								</td>
							</tr>
							<?php endif;?>
							<?php if($reg_date!=""):?>
							<tr>
								<td>
									Tanggal Login Terakhir
								</td>
								<td>
								: <?php echo $lastlogin_date?>
								</td>
							</tr>
							<?php endif;?>
							<?php if($isMyProfile):?>
							<tr>
								<td>
									<a href="<?php echo base_url()?>settings/info">Edit</a>
								</td>
								<td>
								</td>
							</tr>
							<?php endif;?>
						</table>
				
					
					</div>
				</div>
	
			<div class="cls"></div>
		</div>	
	
	<!--footer start -->
	<?php require_once('footer.php');?>
	
	<!--footer end -->
</div>		
</body>
</html>
